#!/usr/bin/python

import os

CSS_BG = 'background: url(../img/maps/%s) 0 %s no-repeat;'
CSS_RULE = '.map.%s{' +  CSS_BG + '}'

def convert2css():
  ls = os.listdir('.')
  css = open('map.css', 'w')
  for f in ls:
    name, ext = os.path.splitext(f)
    if ext == '.png':
      css.write(CSS_RULE % (name, f, '50%'))


if __name__ == '__main__':
  convert2css()
